<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $this->title;?></title>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/css/main.css" />
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/jquery.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/load.js"></script>

<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/jquery.colorbox.js"></script>
<link href="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/colorbox2.css" rel="stylesheet" type="text/css"/>
</head>

<body>
	<div id="main">
		<div id="topMenu">
			<div id="navigation">当前位置：<span id="focus">角色列表</span></div>
			<div id="topOtherMenu">
				<input type="button" name="insert" id="insert" value="添加角色" class="button" onclick="location.href='<?php echo $this->projectUrl(array('action'=>'insert'));?>';" />
			</div>
		</div>
		<div id="body">
			<div id="search">
				<form id="searchForm" name="searchForm" method="post" action="<?php echo $this->projectUrl(array('groupId'=>$this->groupId));?>">
					<table width="100%" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td>
								名称：
									<input name="name" type="text" class="input" id="name" size="10" value="<?php echo $this->vars['name'];?>" />
								&nbsp;
								
								所在公司：
								<input name="partnerName" type="text" class="input" id="partnerName" size="10" value="<?php echo $this->vars['partnerName'];?>" />
&nbsp;
<input name="search" type="submit" id="search2" value="查找" class="button" /></td>
						</tr>
					</table>
				</form>
			</div>
			<div id="content">
				<form id="listForm" name="listForm" method="post" action="">
					<table class="table">
						<tr class="subject">
							<td width="5%" class="checkBoxTd">选择</td>
							<td>名称</td>
							<td>公司</td>
							<td>添加用户</td>
							<td>添加时间</td>
							<td width="15%" class="checkBoxTd">操作</td>
						</tr>
<?php foreach($this->rows as $row) {?>
						<tr class="dataLine">
							<td width="5%" class="checkBoxTd"><input type="checkbox" name="selectId[]" id="selectId<?php echo $row['id'];?>" class="selectCheckBox" value="<?php echo $row['id'];?>" /></td>
							<td><?php echo $row['name'];?></td>
							<td><?php echo $row['type'] == 1 ? '<span style="color:#00f">YEK</span>' : (!empty($row['partnerName']) ? $row['partnerName'] : '<span style="color:#f00">未知</span>');?></td>
							<td><?php echo $row['addUserName'] != '' ? $row['addUserName'] : '&nbsp;';?></td>
							<td><?php echo $row['addTime'];?></td>
							<td width="15%" class="checkBoxTd">
								<a href="javascript:void(0);" onclick="$(document).ready(function(){$.fn.colorbox({href:'<?php echo $this->projectUrl(array('action'=>'get-role-user-json', 'roleId'=>$row['id']));?>?'+Math.random()});});">用户</a>
								<a href="<?php echo $this->projectUrl(array('action'=>'update', 'id'=>$row['id'], 'backUrl'=>urlencode($this->pageUrl))) ;?>">编辑</a>
								<a href="<?php echo $this->projectUrl(array('action'=>'menu-set', 'id'=>$row['id'], 'backUrl'=>urlencode($this->pageUrl))) ;?>">权限</a>
							</td>
						</tr>
<?php
}
?>
					</table>
<table class="controlTable">
						<tr>
							<td align="left">
								<input type="button" name="all" id="all" value="全选" class="button" onclick="$('.selectCheckBox').attr('checked', true);"/>
								<input type="button" name="cancel" id="cancel" value="取消" class="button" onclick="$('.selectCheckBox').attr('checked', false);"/>
								<input type="submit" name="delete" id="delete" value="删除选中" class="button" onclick="return del();"/>
							</td>
							 <td colspan="6" align="right" class="paginator"><?php echo $this->pageString;?></td>
					</tr>
					</table>
				</form>
			</div>
		</div>
</div>
<script language="javascript">
function del()
{
	if (confirm('确定删除选中角色吗？')){
		$('#listForm').attr('action', '<?php echo $this->projectUrl(array('action'=>'delete','backUrl'=>urlencode($this->pageUrl))) ;?>');
	}
	else{
		return false;
	}
}
</script>
</body>
</html>